
<h1> Settings </h1>
<div class="breadcrumb">
        <a href="/admin/index">Home</a>
         :: <a href="/admin/setting">Settings</a>
</div>
	<?php  if(isset($this->success)) {?>
<div class="success" style="text-align: center;"><?php echo $this->success;?></div>
	<?php }?>
	<?php if(isset($this->warning)) {?>
<div class="warning" style="text-align: center;"><?php  echo $this->warning;?></div>
	<?php }?>
<div class="box">
	<div class="heading">
		<h1><img alt="" src="/images/admin/setting.png"> Settings</h1>
		<div class="buttons">
			<a class="button" onclick="$('#form').submit();"><span>Save</span></a>
		</div>
    </div>
    <div class="content">
		<form id="form" enctype="multipart/form-data" method="post" action="/admin/setting">
        <table class="form">
            <tbody>
			
			<tr>
              <td><span class="required"></span> Store Name:</td>
              <td><input type="text" maxlength="100"  size="40" value="<?php if(isset($this->currentsetting) && $this->currentsetting!=null) { echo $this->currentsetting['config_name'];}?>" name="config_name">
                </td>
            </tr>
            <tr>
              <td><span class="required"></span> Store Owner:</td>
              <td><input type="text" maxlength="100" size="40" value="<?php if(isset($this->currentsetting) && $this->currentsetting!=null) { echo $this->currentsetting['config_owner'];}?>" name="config_owner">
                </td>
            </tr>
            <tr>
              <td><span class="required"></span> Address:</td>
              <td><textarea rows="5" cols="40" name="config_address"><?php if(isset($this->currentsetting) && $this->currentsetting!=null) { echo $this->currentsetting['config_address'];}?></textarea>
                </td>
            </tr>
            <tr>
              <td><span class="required"></span> E-Mail:</td>
              <td><input type="text" size="40" value="<?php if(isset($this->currentsetting) && $this->currentsetting!=null) { echo $this->currentsetting['config_email'];}?>" name="config_email">
                </td>
            </tr>
            <tr>
              <td><span class="required"></span> Telephone:</td>
              <td><input type="text" maxlength="15" value="<?php if(isset($this->currentsetting) && $this->currentsetting!=null) { echo $this->currentsetting['config_telephone'];}?>" name="config_telephone">
                </td>
            </tr>
            <tr>
              <td>Fax:</td>
              <td><input type="text" maxlength="30" value="<?php if(isset($this->currentsetting) && $this->currentsetting!=null) { echo $this->currentsetting['config_fax'];}?>" name="config_fax"></td>
            </tr>
            <tr>
              <td>Template:</td>
              <td ><select onchange="$('#template').load('/admin/setting/template?template=' + encodeURIComponent(this.value));" name="config_template">
                                                    
                                                    <?php foreach($this->template as $tem) {?> 
                                                     <?php  if(isset($this->currentsetting) && $this->currentsetting['config_template']==$tem){ ?>
                                                      <option selected="selected" value="<?php echo $tem;?>"><?php echo $tem;?></option>
                                                      <?php } else { ?>
                                                      <option value="<?php echo $tem;?>"><?php echo $tem;?></option>
                                                      <?php } } ?>
                                                    </select>
			  </td>
            </tr>
            <tr>
              <td align="center" id="template" colspan="2"><img  width="800px" height="600px" style="border: 1px solid #EEEEEE;" title="" alt=""  src="/images/templates/<?php echo $this->currentsetting['config_template'];?>.png" ></td>
            </tr>
            
			</tbody>
        </table>
        </form>
    </div>
</div>

